// 3. 享元工厂（管理共享对象池）
public class CharacterFactory
{
  private Dictionary<string, ICharacter> _flyweights = new();

  public ICharacter GetCharacter(char symbol, string font)
  {
    string key = $"{symbol}_{font}";
    if (!_flyweights.ContainsKey(key))
    {
      _flyweights[key] = new Character(symbol, font);
    }
    return _flyweights[key];
  }

  public int Count => _flyweights.Count;
}